package src

import (
	"github.com/gin-gonic/gin"
	"goft/src/goft"
	"log"
)

type Index struct {
	*goft.GormAdapter
}
type test struct {
	id       int
	userid   int
	username string
}

func NewIndex() *Index {
	return &Index{}
}

func (this *Index) context(c *gin.Context) string {
	modeltest := test{}
	db := this.Find(&modeltest)
	log.Println(modeltest.username)
	goft.Error(db.Error)
	return modeltest.username
}
func (i *Index) Build(c *goft.Goft) {
	c.Handle("GET", "/", i.context)
}
